import request from '@/utils/request'
// import store from '@/store'

export function getFunction(params) {
  return request({
    url: '/sys/function/getUserMenu',
    method: 'get',
    params
  })
}

export function getYears() {
  return request({
    url: '/init/getYear',
    method: 'get'
  })
}

export function fileUploadBase64(file) {
  return request({
    method: 'post',
    url: '/upload/oss/imageBase64',
    data: {
      base64: file
    },
    transformRequest: (data) => {
      const fd = new FormData()
      for (const i in data) {
        fd.append(i, data[i])
      }
      return fd
    }
  })
}
